package database;
import java.sql.*;

public class CreateTable{
  public static void main(String[] args) {
    System.out.println("Table Creation Example!");
    Connection con = null;
    String dburl = "jdbc:postgresql://192.168.61.205:5432/license";
    String Name = " ";
    String driverName = "org.postgresql.Driver";
    String userName = "postgres";
    String password = " ";
    try{
      Class.forName(driverName).newInstance();
      con = DriverManager.getConnection(dburl, userName, password);
      try{
        Statement st = con.createStatement();
        String table = "CREATE TABLE Employee11(Emp_code integer, Emp_name varchar(10))";
        st.executeUpdate(table);
        System.out.println("Table creation process successfully!");
      }
      catch(SQLException s){
        System.out.println("Table all ready exists!");
      }
      con.close();
    }
    catch (Exception e){
      e.printStackTrace();
    }
  }
}